//
//  JSTUserNickCell.m
//  KYKJPackDemo
//
//  Created by 01 on 17/6/19.
//  Copyright © 2017年 ???. All rights reserved.
//

#import "JSTUserNickCell.h"

@interface JSTUserNickCell ()

@end

@implementation JSTUserNickCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (id) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        _label = [[UILabel alloc] init];
        CGFloat labelX = EvaluationCellInset;
        CGFloat labelY = EvaluationCellInset*2;
        CGSize size = [NSString sizeWithString:@"昵称:" font:kSystemFont(kCurrentScreenWidth(12)) CGsize:CGSizeMake(kDeviceWidth, MAXFLOAT)];
        _label.frame = (CGRect){{labelX, labelY}, size};
        _label.text = @"昵称:";
        _label.font = kSystemFont(kCurrentScreenWidth(12));
        _label.textAlignment = NSTextAlignmentCenter;
        [self addSubview:_label];
        
//        _textFd = [[UITextField alloc] init];
//        [self addSubview:_textFd];
    }
    return self;
}

- (void) createContent
{
    CGFloat labelX = EvaluationCellInset;
    CGFloat labelY = EvaluationCellInset*2;
    CGSize size = [NSString sizeWithString:@"昵称:" font:kSystemFont(kCurrentScreenWidth(12)) CGsize:CGSizeMake(kDeviceWidth, MAXFLOAT)];
    CGSize maxSize = [NSString sizeWithString:@"昵称昵称:" font:kSystemFont(kCurrentScreenWidth(12)) CGsize:CGSizeMake(kDeviceWidth, MAXFLOAT)];
    _label.frame = (CGRect){{labelX, labelY}, size};
    _label.text = @"昵称:";
    _label.font = kSystemFont(kCurrentScreenWidth(12));
    _label.textAlignment = NSTextAlignmentCenter;
    
    CGFloat textFdX = CGRectGetMaxX(_label.frame) + maxSize.width - size.width + EvaluationCellInset;
    CGFloat textFdY = 0;
    CGFloat textFdW = kDeviceWidth - textFdX - EvaluationCellInset;
    CGFloat textFdH = CGRectGetMaxY(_label.frame) + EvaluationCellInset*2;
    _textFd.frame = CGRectMake(textFdX, textFdY, textFdW, textFdH);
    _textFd.placeholder = @"请填写";
    _textFd.font = kSystemFont(kCurrentScreenWidth(12));
}



- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
